home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: void main() and other atrocities!
- Date: 06 Feb 1996 04:56:06 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb5215606@qcd.lanl.gov>
- References: <4eduaj$1aq@grouper.Exis.Net> <4em17r$shq@jaxnet.jaxnet.com>
- <4emub9$1mo@fountain.mindlink.net> <4epplj$egf@host-3.cyberhighway.net>
- <4erjn2INN38b@keats.ugrad.cs.ubc.ca>
- <9602021300.AA04359@dxmint.cern.ch>
- <4f5vc2$qcj@cdn_news.telecom.com.au>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: jolson@vprpmel1.telecom.com.au's message of Tue, 06 Feb 96 19:11:31 GMT
-
- In article <4f5vc2$qcj@cdn_news.telecom.com.au>
- jolson@vprpmel1.telecom.com.au (Jeff Olson) writes:
- How about:
-
- int main (int argc, char **argv)
-
- I saw in the FAQ that a multi-dimentional array will not decay into
- a pointer
- to a pointer. This main() is valid with my Sparcworks compiler so
- I would
-
-
- argv is not a multidimensional array, you can think of main as being
- called with a parameter that is an array of pointers which decays
- in the normal fashion to a pointer to pointer.
-
- As an array almost always decays to a pointer in a parameter list, an
- object declared as an array in a parameter list is declared as a
- pointer itself. Thus, char *argv[] and char **argv are equivalent in
- the prototype of main.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-